const { Schema, model } = require('mongoose');
const claimsSchema = new Schema({
    time: {
        type: Date,
        required: 'Please fill From Date',
        trim: true
    },
    address:String,
    // voucher:String,
    reason:String,
    state:{
        type:Number,
        default: 1,
    },
    voucher: {
        type: Array,
        default: [],
    },
    delete: {
        type: Boolean,
        default: false,
    },
    belongToOrders: {
        type: Schema.Types.ObjectId,
        ref: 'ordersModel'
    },
    belongToSales: {
        type: Schema.Types.ObjectId,
        ref: 'salesModel'
    }

}, { versionKey: false });

const claimsModel = model('claimsModel', claimsSchema, 'claims');

module.exports.claimsModel = claimsModel;